/**
 * @file     singleNumber.js
 * @brief    [136. 只出现一次的数字](https://leetcode.cn/problems/single-number/)
 * @author   Zhu
 * @date     2022-10-23 04:04
 */

/**
 * @param {number[]} nums
 * @return {number}
 */
var singleNumber = function (nums) {
    let res = 0;
    for (const num of nums) {
        res ^= num;
    }

    return res;
};
